// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; version 2 of the License.

// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.

#pragma once
#include "orbit.h"
#include <vector>
#include "GravBody.h"

#include <functional>

class EllipticalOrbit :	public Orbit
{
public:
	EllipticalOrbit(double _pericenterDistance, double _eccentricity, double _inclination, double _ascendingNode,
		double _argOfPeriapsis, double _meanAnomalyAtEpoch, double _period, double _epoch = 2451545.0);
	virtual ~EllipticalOrbit(void);

	virtual VECTOR computePosition(double jd);
private:
	virtual double eccentricAnomaly(double) const;
	virtual VECTOR positionAtE(double) const;
	//Vec3d velocityAtE(double) const;
	double pericenterDistance;
	double eccentricity;
	double inclination;
	double ascendingNode;
	double argOfPeriapsis;
	double meanAnomalyAtEpoch;
//	double period;
	double epoch;
	Mat3 orbitPlaneRotation;
public:
	//double getPeriod() { return period; }
	//GravBody* parent;
};
